﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace l1cs_cl.client.receivepackets
{
    class R_InvList : ReceiveBasePacket
    {
        public R_InvList( byte[] abyte0 )
            : base( abyte0 )
        {
            int itemCount = readC(); // アイテム数

            for (int i=0; i< itemCount; i++) 
            {
                Item item = new Item();
                item.id = readD();//readD( item.getId() );
                item.type = readC();//readC( item.getItem().getUseType() );
                readC();//readC( 0 );
                item.gfxid = readH();//readH( item.get_gfxid() );
                item.bless = readC();//readC( item.getBless() );
                item.count = readD();//readD( item.getCount() );
                item.identified = readC();//readC( ( item.isIdentified() ) ? 1 : 0 );
                item.viewName = readS();//readS( item.getViewName() );
                item.status = readC();
#if DEBUG
                String str = String.Format(
                    "id={0}\ntype={1}\ngfxid={2}\nbless={3}\ncount={4}\nidentified={5}\nviewName={6}\nstatus={7}",
                    item.id,
                    item.type,
                    item.gfxid,
                    item.bless,
                    item.count,
                    item.identified,
                    item.viewName,
                    item.status );
                Console.WriteLine( str );
#endif
            }
        }
    }
}
